﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008"
    xmlns:local="clr-namespace:GestureControl">
    
    <local:DoubleHalfConverter x:Key="DoubleHalfConverter" />
    
    <Style TargetType="{x:Type local:GestureControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:GestureControl}">
                    <Border Background="Transparent"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Width="{Binding ElementName=CC,Path=ActualWidth}"
                            Height="{Binding ElementName=CC,Path=ActualHeight}">
                            <!-- BorderThickness="{TemplateBinding BorderThickness}">  -->
                        <Grid>
                            <ContentControl x:Name="CC" BorderBrush="red" BorderThickness="3" Content="{TemplateBinding Content}"></ContentControl>
                           <s:SurfaceInkCanvas Width="{Binding ElementName=CC,Path=ActualWidth,Converter={StaticResource DoubleHalfConverter}}" Height="{Binding ElementName=CC,Path=ActualHeight,Converter={StaticResource DoubleHalfConverter}}" x:Name="InkArea">
                                <s:SurfaceInkCanvas.DefaultDrawingAttributes >
                                    <DrawingAttributes 
                                    Color = "Blue" Width = "4" />
                                </s:SurfaceInkCanvas.DefaultDrawingAttributes>
                            </s:SurfaceInkCanvas>
                            <!-- <s:SurfaceTextBox Width="100" Height="50" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Gesture}" /> -->
                        </Grid>
                    </Border>  
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
